import request from '../request'
import type { CommentDto, CommentVo } from '../types/comment'

export const getCommentList = async (params: { momentId: string; page: number; size: number }) => {
    try {
        const res = await request.get<CommentVo[]>('/comment', params)
        return res.data
    } catch (err) {
        throw err
    }
}

export const createComment = async (params: CommentDto) => {
    try {
        const res = await request.post('/comment', params)
        return res.data
    } catch (err) {
        throw err
    }
}
